Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly parse peer address #68

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

smira
Copy link
Member

@smira smira commented Sep 26, 2024

After switch to Go's http/server, the peer address comes wrapped, so use a different method to unwrap it.

The tests haven't caught that, as they were using gRPC's server, so switch tests to use same approach as production, ans enable HTTP/2 over TLS, as otherwise h2c is a mess, and it doesn't abort connections properly for test purposes.

After switch to Go's http/server, the peer address comes wrapped, so use
a different method to unwrap it.

The tests haven't caught that, as they were using gRPC's server, so
switch tests to use same approach as production, ans enable HTTP/2 over
TLS, as otherwise h2c is a mess, and it doesn't abort connections
properly for test purposes.

Signed-off-by: Andrey Smirnov <[email protected]>
@@ -38,10 +36,8 @@ func PeerAddress(ctx context.Context) netip.Addr {
}

if peer, ok := peer.FromContext(ctx); ok {
if addr, ok := peer.Addr.(*net.TCPAddr); ok {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the actual fix, everything else is improving tests

@smira
Copy link
Member Author

smira commented Sep 26, 2024

/m

@talos-bot talos-bot merged commit efbb10b into siderolabs:main Sep 26, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants